<?php

namespace App\Http\Middleware\Admins;
use Illuminate\Support\Facades\Route;
use Closure;

class Permission
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
    		$currentRouteName = Route::currentRouteName();
		
			
		if(!in_array($currentRouteName,config('admins.globals.no_check_permission')) && !sp_check_auth($currentRouteName)){
			abort(403,'没有权限');
		}
        return $next($request);
    }
}
